package cz.techi;

import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;
import android.widget.TextView;

public class ScheduleWidgetProvider extends AppWidgetProvider {

    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        final int N = appWidgetIds.length;

        
/*
        ScheduleDb sd = new ScheduleDb();
        Subject[] subjects = sd.getSubjects();
        sd.close();
        
        
        if (subjects.length == 0)
        {
        	
        }

        Schedule schedule = Schedule.getInstance();
        schedule.setSubjects(subjects);
        
        
        
        
        
        Subject s = schedule.getNextSubject();
        
        if (s != null)
        {

        	TextView text = (TextView)this.findViewById(R.id.info);
        	text.setText("Next subject: " + s.ident + "\n" + s.getLocalizedDay() + " " + s.from + "-" + s.to + "\n" + s.name + "\n" + s.room + "\n" + s.type + " " + s.teacher);
        }
        */
        
//        RemoteViews rvs = new RemoteViews(context.getPackageName(), R.layout.main);
//        rvs.setTextViewText(R.id.widgetText, "we updated! yay!");
//        appWidgetManager.updateAppWidget(new ComponentName(context, ScheduleWidgetProvider.class), rvs);
        
    }
}